package cn.flyme.shop.service.impl;

import cn.flyme.shop.entities.Goods;
import cn.flyme.shop.entities.GoodsExample;
import cn.flyme.shop.mapper.GoodsMapper;
import cn.flyme.shop.service.SupermarketService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class SupermarketServiceImpl implements SupermarketService {

    @Autowired
    GoodsMapper mapper;

    @Override
    public PageInfo searchGoods(String search, Integer page, Integer size) {
        PageHelper.startPage(page,size);
        List<Goods> goods = mapper.selectByExample(new GoodsExample());
        return new PageInfo(goods);
    }
}
